/**
 * @file bull_hal_drv_led.h
 * @brief 
 * @author yejing (yejh@gongniu.cn)
 * @version 1.0
 * @date 2024-07-08
 * 
 * Copyright 2024-2025 GongNiu Inc. All Rights Reserved.
 * 
 */

#ifndef __BULL_HAL_DRV_LED_H__
#define __BULL_HAL_DRV_LED_H__

#include "bull_hal_adapter.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @brief LEDC控制模块初始化
 * 
 * @param gpio_num  PWM输出引脚
 * @param frequence PWM输出频率，取值范围是0-10K
 * @param polarity  PWM输出极性，1为高电平有效，0为低电平有效
 * @param duty      PWM初始占空比
 * @return int PWM通道编号，失败返回值小于0
 */
int bull_hal_drv_led_pwm_init( int gpio_num, int frequence, int polarity ,float duty );

/**
 * @brief led控制的pwm占空比设置
 * 
 * @param channel_num   PWM通道编号
 * @param duty          占空比0~100
 */
void bull_hal_drv_led_pwm_duty_set( int channel_num, float duty );

/**
 * @brief 失能 led pwm功能
 * 
 */
void  bull_hal_drv_led_pwm_uninstall( void );


#ifdef __cplusplus
}
#endif

#endif